const { ccclass, property } = cc._decorator;

@ccclass
export default class taskListControl extends cc.Component {
    @property(cc.Label)
    titelLabel: cc.Label = null;
    @property(cc.Label)
    describeLabel: cc.Label = null;
    @property(cc.Label)
    degreeLabel: cc.Label = null;
    @property(cc.Label)
    awardCountLabel: cc.Label = null;
    @property(cc.Sprite)
    awardType: cc.Sprite = null;
    @property(cc.Button)
    getAwardBt: cc.Button = null;
    @property(cc.SpriteFrame)
    finishedSprite: cc.SpriteFrame = null;
    @property
    _timeType: number = 0;
    @property
    _awardType: number = 0;
    @property
    _awardCount: number = 0;
    @property
    _describe: number = 0;
    @property
    _targetType: number = 0;
    @property
    _id: string = "";
    @property
    _isFinished: boolean = false;


    showdescribe(_describeTo: number) {
        if (this._describe <= _describeTo) {
            this._isFinished = true;
            let fs = new cc.Node();
            let sprite = fs.addComponent(cc.Sprite);
            sprite.spriteFrame = this.finishedSprite;
            this.node.addChild(fs);
            this.describeLabel.string = "";
            return true;
        }
        else {
            let _timeStr = ["每天", "每周", "每月", "永久"];
            this.describeLabel.string = _describeTo + "/" + this._describe + _timeStr[this._timeType];
            return false;
        }
    }
}
